package com.shuhua.pojo.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.shuhua.pojo.vo.UserInfo; // 1. 引入 UserInfo 接口
import lombok.Data;

import java.io.Serializable; // 2. 建议引入 Serializable
import java.util.Date;

/**
 * 管理员实体类
 */
@Data
@TableName("admin")
public class Admin implements Serializable, UserInfo {

    @TableId(type = IdType.AUTO)
    private Long id;

    private String username;

    private String password;

    @TableField("real_name")
    private String realName;

    private String phone;

    private String email;

    private String avatar;

    @TableField("is_super")
    private Boolean isSuper;

    private Boolean status;

    @TableField("last_login_ip")
    private String lastLoginIp;

    @TableField("last_login_time")
    private Date lastLoginTime;

    @TableField("create_time")
    private Date createTime;

    @TableField("update_time")
    private Date updateTime;

    @Override
    public String getUserType() {
        return "admin";
    }
}